package org.bwapi.bridge.model;

import java.util.Set;

import org.apache.commons.collections15.Transformer;
import org.bwapi.bridge.swig.SWIGTYPE_p_std__setT_BWAPI__UnitSizeType_t;
import org.bwapi.bridge.swig.UnitSizeTypeSet;
import org.bwapi.bridge.swig.UnitSizeTypeSetIterator;
import org.bwapi.bridge.swig.bridge;
import org.cretz.swig.collection.NativeSet;


/**
 * Unit size type
 * 
 * @see <a href="http://code.google.com/p/bwapi/wiki/UnitSizeType">UnitSizeType</a>
 * 
 * @author Chad Retz
 */
public class UnitSizeType extends BwapiComparable<UnitSizeType> {
	private static final Transformer<UnitSizeType, org.bwapi.bridge.swig.UnitSizeType> FROM = 
		new Transformer<UnitSizeType, org.bwapi.bridge.swig.UnitSizeType>() {
			@Override
			public org.bwapi.bridge.swig.UnitSizeType transform(UnitSizeType type) {
				return type.getType();
			}
		};
		
	private static final Transformer<org.bwapi.bridge.swig.UnitSizeType, UnitSizeType> TO = 
		new Transformer<org.bwapi.bridge.swig.UnitSizeType, UnitSizeType>() {
			@Override
			public UnitSizeType transform(org.bwapi.bridge.swig.UnitSizeType type) {
				return new UnitSizeType(type);
			}
		};

	public static final UnitSizeType INDEPENDENT = new UnitSizeType(bridge.getUnitSizeTypeIndependent());
	public static final UnitSizeType SMALL = new UnitSizeType(bridge.getSmall());
	public static final UnitSizeType MEDIUM = new UnitSizeType(bridge.getMedium());
	public static final UnitSizeType LARGE = new UnitSizeType(bridge.getLarge());
	public static final UnitSizeType NONE = new UnitSizeType(bridge.getUnitSizeTypeNone());
	public static final UnitSizeType UNKNOWN = new UnitSizeType(bridge.getUnitSizeTypeUnknown());
	
	public static Set<UnitSizeType> allUnitSizeTypes() {
		return newSet(bridge.allUnitSizeTypes());
	}
	
	/**
	 * Not implemented
	 * 
	 * @param name
	 * @return
	 * 
	 * @deprecated Not implemented
	 */
	@Deprecated
	public static UnitSizeType getUnitSizeType(String name) {
		throw new UnsupportedOperationException();
	}
	
	static Set<UnitSizeType> newSet(SWIGTYPE_p_std__setT_BWAPI__UnitSizeType_t nativeSet) {
		return new NativeSet<UnitSizeType, org.bwapi.bridge.swig.UnitSizeType>(
				org.bwapi.bridge.swig.UnitSizeType.class, UnitSizeTypeSetIterator.class, 
				nativeSet, UnitSizeTypeSet.class, FROM, TO);
	}
	
	private final org.bwapi.bridge.swig.UnitSizeType type;
	
	UnitSizeType(org.bwapi.bridge.swig.UnitSizeType type) {
		this.type = type;
	}

	public UnitSizeType() {
		this(new org.bwapi.bridge.swig.UnitSizeType());
	}

	public UnitSizeType(int id) {
		this(new org.bwapi.bridge.swig.UnitSizeType(id));
	}

	public UnitSizeType(UnitSizeType other) {
		this(new org.bwapi.bridge.swig.UnitSizeType(other.getType()));
	}
	
	org.bwapi.bridge.swig.UnitSizeType getType() {
		return type;
	}

	@Override
	public UnitSizeType opAssign(UnitSizeType other) {
		return new UnitSizeType(type.opAssign(other.getType()));
	}

	@Override
	public boolean opEquals(UnitSizeType other) {
		return type.opEquals(other.getType());
	}

	@Override
	public boolean opNotEquals(UnitSizeType other) {
		return type.opNotEquals(other.getType());
	}

	@Override
	public boolean opLessThan(UnitSizeType other) {
		return type.opLessThan(other.getType());
	}

	@Override
	public int getID() {
		return type.getID();
	}

	public String getName() {
		return type.getName();
	}
}
